# CMakeLists.txt

cmake_minimum_required(VERSION 3.12)
project(chicken_project)

# Set C++ standard
set(CMAKE_CXX_STANDARD 11)

# Add the source files
set(SOURCES Chicken.cpp)

# Add the executable
add_executable(chicken ${SOURCES})

# Specify the installation directory
set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX})

# Define the install targets
install(TARGETS chicken DESTINATION "${INSTALL_DIR}/bin")
install(FILES Chicken.h DESTINATION "${INSTALL_DIR}/include")

# generate doxyfile
find_package(Doxygen REQUIRED)
set(DOXYGEN_INPUT Chicken.h)
set(DOXYGEN_OUTPUT_DIR ${INSTALL_DIR}/doc)

find_package(Doxygen REQUIRED)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Chicken.h ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

add_custom_target(
    doxygen
    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMENT "Generating API documentation with Doxygen"
    VERBATIM
)
